import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter as MyRouter, Routes, Route, Navigate } from 'react-router-dom';
import './index.less';
import App from './App';
import { RecoilRoot } from 'recoil';
import { MainRouter } from './routes'

ReactDOM.render(
  // <React.StrictMode>
  <RecoilRoot>
    <MyRouter>
      <Routes>
        {/* { 不是嵌套就需要尾部加上 * } */}
        <Route path="/*" element={<App />} />
        {
          MainRouter.map((route: any) => {
            return <Route key={route.path} path={route.path} element={route.element} />
          })
        }
      </Routes>
    </MyRouter>
  </RecoilRoot>,
  // </React.StrictMode>,
  document.getElementById('root')
);
